package com.jzy.gulimall.cart.vo;

import java.math.BigDecimal;
import java.util.List;

/**
 * @author jzy
 * @date 2020/9/18 13:58
 * 购物项内容
 */
public class CartItemVo {

    private Long skuId;

    private Boolean check = true;   //是否被选中

    private String title;   //标题

    private String image; //图片

    private List<String> skuAtr;   //销售属性

    private BigDecimal price;   //价格

    private Integer count;  //数量

    private BigDecimal totalPrice; //总计

    public Long getSkuId() {
        return skuId;
    }

    public void setSkuId(Long skuId) {
        this.skuId = skuId;
    }

    public Boolean getCheck() {
        return check;
    }

    public void setCheck(Boolean check) {
        this.check = check;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getImage() {
        return image;
    }

    public void setImage(String image) {
        this.image = image;
    }

    public List<String> getSkuAtr() {
        return skuAtr;
    }

    public void setSkuAtr(List<String> skuAtr) {
        this.skuAtr = skuAtr;
    }

    public BigDecimal getPrice() {
        return price;
    }

    public void setPrice(BigDecimal price) {
        this.price = price;
    }

    public Integer getCount() {
        return count;
    }

    public void setCount(Integer count) {
        this.count = count;
    }

    /**
     * @return 计算购物项总计
     */
    public BigDecimal getTotalPrice() {
        return this.price.multiply(new BigDecimal(this.count));
    }
}
